]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Sanity check coordinates in scrollContentsTo
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 6 Feb 2020 09:52:24 +0000 (10:52 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 7 Feb 2020 17:18:25 +0000 (18:18 +0100)
We may receive a11y events with bogus coordinates (eg. x/y = minint),
so ensure the coordinates are sane before scrolling there.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/984

js/ui/magnifier.js

index 7250ce530b2a13367a7f4ac1954bf20a8c9ad29a..4978196409389ce6cee6580b9f51dfab15be45d9 100644 (file)
@@ -1168,6 +1168,10 @@ var ZoomRegion = class ZoomRegion {
      * @param {number} y: The y-coord of the point to center on.
      */
     scrollContentsTo(x, y) {
+        if (x < 0 || x > global.screen_width ||
+            y < 0 || y > global.screen_height)
+            return;
+
         this._clearScrollContentsTimer();
 
         this._followingCursor = false;